var Browser = require('zombie');
var assert = require('assert');
var browser;
suite('Cross-Page Tests', function(){
    setup(function(){
        browser = new Browser();
    });

    test('requiresting a group rate quot from the hood river tour page' +
        'should populate the referer field', function(done){
        var referer = 'http://localhost:3200/tours/hood-river';
        browser.visit(referer, function(){
            browser.clickLink('.requestGroupRate', function(){
                assert(browser.field('referer').value === referer);
                done();
            });
        })
    })

    test('requiresting a group rate quot from the Oregon coast tour page' +
        'should populate the referer field', function(done){
        var referer = 'http://localhost:3200/tours/oregon-coast';
        browser.visit(referer, function(){
            browser.clickLink('.requestGroupRate', function(){
                assert(browser.field('referer').value === referer);
                done();
            }); b
        })
    })

    test('visiting the "request group rate" page dirctly should result' +
        'in an empty referer field', function(done){
        var referer = 'http://localhost:3200/tours/request-group-rate';
        browser.visit(referer, function(){
            assert(browser.field('referer').value === '');
            done();
        })
    })

})